package org.javaboy.cors01.controller;

import org.springframework.web.bind.annotation.*;

@RestController
@RequestMapping("/book")
//@CrossOrigin(value = "http://localhost:8081",maxAge = 1800)
public class BookController {

    @GetMapping
//    @CrossOrigin("http://localhost:8081")
    public String getBook() {
        System.out.println("getBook");
        return "getBook";
    }

    @PostMapping
//    @CrossOrigin("http://localhost:8081")
    public String addBook() {
        System.out.println("addBook");
        return "addBook";
    }

    @PutMapping
//    @CrossOrigin("http://localhost:8081")
    public String updateBook() {
        System.out.println("updateBook");
        return "updateBook";
    }

    @DeleteMapping
//    @CrossOrigin("http://localhost:8081")
    public String deleteBook() {
        System.out.println("deleteBook");
        return "deleteBook";
    }
}
